# Idle.gd
extends State
@onready var animated_sprite: AnimatedSprite2D = $"../../AnimatedSprite"

#TODO： 这里考虑之后要不要换成通用的受伤效果
func enter():
	var tween = create_tween()
	if animated_sprite.material is ShaderMaterial:
		animated_sprite.material.set_shader_parameter("flash_intensity", 1.0)
		tween.tween_property(animated_sprite.material, "shader_parameter/flash_intensity", 0.0, 0.3)
		tween.tween_property(animated_sprite.material, "shader_parameter/flash_intensity", 0.0, 0.3)
	await tween.finished
	state_machine.transition_to("Idle")
	
func process_logic(delta: float):
	pass

func input_logic(event: InputEvent):
	pass

func exit():
	print("玩家 退出了 受伤 状态 ")
